<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="time"></div>
</body>
<script>

    /*moment.js*/
    setInterval(setTime,1000);
  //  clearInterval(setTime)
    function setTime() {
        var d = new Date();
        var hour = d.getHours();
        var muniute= d.getMinutes();
        var sec = d.getSeconds();

        if(hour.toString().length==1){
            hour="0"+hour;
        }
        if(muniute.toString().length==1){
            muniute="0"+muniute;
        }
        if(sec.toString().length==1){
            sec="0"+sec;
        }
        var message = hour+":"+muniute+":"+sec;
        var time = document.getElementById('time');

        time.innerText = message;
    }
  ;

</script>
</html>